package com.example.denglu.enums;

public enum PositionEnum {
    //开发，测试，产品，管理
    POSITIONENUM("0","positionenum"),
    CHECKOUT("1","checkout"),
    PRODUCT("2","product"),
    ADMINISTRATION("3","administration");


    public  final  String code;
    public final  String name;


    PositionEnum(String code,String name){
        this.code=code;
        this.name=name;
    }
    public static PositionEnum forCode (String code) {
        for (PositionEnum item : PositionEnum.values()) {
            if (item.code.equals(code)) {
                return item;
            }
        }
        return null;
    }
    public static  PositionEnum forname (String name){
        for (PositionEnum item : PositionEnum.values()){
            if (item.name.equals(name)){
                return item;
            }
        }
        return null;
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }
}
